package com.project;

import java.io.File;

import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class ShowDetail extends Activity {

	private DBHelper dbHelp;
	private Cursor cur;
	String img;
	Bundle bundle;
	String iname;
	String idetail;
	String ipic = "";
	String iID;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.showdetail);
        
        try{
	        bundle = this.getIntent().getExtras();
	        iname = bundle.getString("name");
	        idetail = bundle.getString("detail");
	        iID = bundle.getString("id");
	        ipic = bundle.getString("pic");
	        
	        File file = new File(ipic);
			Uri uri = Uri.fromFile(file);
	        
	        ImageView pichotel = (ImageView)findViewById(R.id.ImageView01);
	        //int resID =  getResources().getIdentifier(img, "drawable", "com.project");
	        pichotel.setImageURI(uri);
	        pichotel.setMaxHeight(300);
	        pichotel.setMaxWidth(200);
	        Toast.makeText(this, uri+"", Toast.LENGTH_SHORT).show();
	        
	        TextView edit1 = (TextView)findViewById(R.id.EditText01);
	        TextView edit2 = (TextView)findViewById(R.id.EditText02);
	        edit1.setText("Name : "+iname);
	        edit2.setText("Description : "+idetail );
        }catch (Exception e) {
        	TextView edit1 = (TextView)findViewById(R.id.EditText01);
            edit1.setText(""+e);
		}
	}
}
